package edu.neusoft.yiqibike.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import edu.neusoft.yiqibike.common.datasource.TargetDataSource;
import edu.neusoft.yiqibike.common.entity.Apply;
import edu.neusoft.yiqibike.dao.mapper.ApplyMapper;
import edu.neusoft.yiqibike.service.IApplyService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author YooLin1c
 * @since 2018-03-13
 */
@Service
public class ApplyServiceImpl extends ServiceImpl<ApplyMapper, Apply> implements IApplyService {

    @Override
    @TargetDataSource(name = "ds2")
    public Page<Apply> getList(Page<Apply> page) {
        return this.selectPage(page);
    }

    @Override
    @TargetDataSource(name = "ds2")
    public boolean add(Apply apply) {
        return apply.insert();
    }

    @Override
    @TargetDataSource(name = "ds2")
    public boolean edit(Apply apply) {
        return apply.updateById();
    }

    @Override
    @TargetDataSource(name = "ds2")
    public boolean deleteBatchByIds(List<String> ids) {
        return this.deleteBatchIds(ids);
    }
}
